package com.vivek.guess.what.calculator;

import java.util.List;

import com.vivz.guess.what.vo.Guess;
import com.vivz.guess.what.vo.ProbabilityMatrix;

/**
 * 1. Update the definite outsiders FIRST
 * 
 * If the weight is zero, remove all the characters from the probability map or make their probability zero.
 */
public class ZeroWeightCalculator extends AbstractCalculator {

	@Override
	public void calculate(final List<Guess> guesses, final ProbabilityMatrix pMatrix) {

		final Guess lastGuess = guesses.get(guesses.size() - 1);

		if (lastGuess.getClue().hasDash()) {
			for (final Character c : lastGuess.getWord().toCharArray()) {
				pMatrix.markImpossibleCharacter(c);
			}
		}
	}

}
